#include <gio/gio.h>

int main(int argc,char *argv[])
{
    GFile *file = g_file_new_for_uri("http://git.oschina.net/add358/demo/raw/master/COPYING");
    GFileInputStream *fileInputStream = g_file_read(file, NULL, NULL);
    gchar buf[2048] = {0};

    g_input_stream_read(G_INPUT_STREAM(fileInputStream), buf, 2048, NULL, NULL);
    g_message("content:\n%s", buf);
    g_object_unref(file);
    return 0;
}
